package com.hlddz.venue_reservation.mapper;

import com.hlddz.venue_reservation.entity.User;
import org.apache.ibatis.annotations.*;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author MoShang
 * @since 2024年05月31日
 */
@Mapper
public interface UserMapper{
    @Select("select * from user where username = #{username} and password = #{password}")
    User userLogin(User user);

    @Insert("insert into user(username, password, phone_number) values (#{username},#{password},#{phoneNumber})")
    void userRegister(User user);

    @Update("update user set nickname = #{nickname} , phone_number = #{phoneNumber} where username = #{username}")
    void userUpdateInfo(User user);

    @Update("update user set password = #{password} where username = #{username}")
    void userUpdatePassword(User user);

    @Select("select * from user where username = #{username}")
    User getUserInfo(String username);
}
